<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="google-site-verification" content="yaeorbXgKPwp5BDegBtAJEHYWFEFE-BViWTj74gJPrw" />
<!--  -->
<link href="/css/default.css" type="text/css" rel="stylesheet" />
<!--  -->
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/lang/en.js"></script>
<script type="text/javascript" src="/js/mac/core.min.js"></script>
<title>JQuery MagicCombo Basic demo</title>
<meta name="description" content="JQuery MagicCombo Basic demo" />
<meta name="keywords" content="JQuery ComboBox Plugin" />
<!-- <link href="/src/css/default/mac/combo/combo.css" type="text/css" rel="stylesheet" /> -->
<!-- <script type="text/javascript" src="/src/js/mac/combo.js"></script> -->
<link href="/css/default/mac/combo/combo.min.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/mac/combo.min.js"></script>
<script type="text/javascript">
$(function(){
	$('#nav_jump').change(function(){
		location = './' + this.value + '.html';
	}).val('basic');
	$('.demoSource').val($('#demo').html());
});
</script>
</head>
<body>
<div id="head">
	<a href="/en/"><img src="/css/images/logo_s.png" alt="logo" /></a>
	<div class="title">BOARSOFT.COM</div>
	<div class="right">
		<div>
			<a href="/public/lang.php?l=en">English</a>
			|
			<a href="/public/lang.php?l=cn">简体中文</a>
			|
			<a href="http://activemq.apache.org/" target="_blank">ActiveMQ</a>
			|
			<a href="https://redis.io/" target="_blank">Redis</a>
			|
			<a href="http://www.jquery.com/" target="_blank">JQuery</a>
		</div>
	</div>
</div><div id="nav">
	<div id="nav_path">
		&nbsp;<a href="/en/">Home</a>
		&gt;
		<a href="/en/mac/js/combo">JQuery MagicCombo</a>
		&gt;
		JQuery MagicCombo Basic demo	</div>
	<div id="nav_back">
		<a href="/en/mac/js/combo/doc">Document</a>
		|
		<a href="javascript:history.back()">Back</a>
		|
		<a href="/mac/js/combo/dl/basic.html">Download</a>
		|
		<select id="nav_jump">
			<option value="basic">JQuery MagicCombo Basic demo</option>
			<option value="remote">JQuery MagicCombo Load data from remote</option>
			<option value="custom">JQuery MagicCombo Custom style demo</option>
			<option value="grid1">JQuery Grid ComboBox Single Selection</option>
			<option value="grid2">JQuery Grid ComboBox Multi Selection</option>
			<option value="autoCp">JQuery MagicCombo Auto complete demo</option>
		</select>
		&nbsp;&nbsp;
	</div>
	<div class="clear"></div>
</div>
<div class="demoInfo">
	<h2 class="demoTitle">JQuery MagicCombo Basic demo</h2>
</div>
<div id="demo" class="demoPanel"><script type="text/javascript">
$(function(){
	var dd = [];
	for(var i=1;i<=5; i++)
		dd.push({ code: i + '', name: 'Employee ' + i });
	var cfg = {
		keyField: 'code',
		displayField: 'name',
		multiSelect: false,
		width: 200,
		boxWidth: 200,
		cols : [{
			field: 'code', width: '30%'
		},{
			field: 'name', width: '70%'
		}],
		data: dd
	};
	var cfg1 = $.extend({}, cfg);
	var cb1 = $('#combo1').mac('combo', cfg1);
	$('#get1').click(function(){
		alert(cb1.selected);
	});
	$('#set1').click(function(){
		cb1.select(2);
	});
	var cfg2 = $.extend({}, cfg);
	cfg2.multiSelect = true;
	var cb2 = $('#combo2').mac('combo', cfg2);
	$('#get2').click(function(){
		alert(cb2.selected.join(','));
	});
	$('#set2').click(function(){
		cb2.select([2,4]);
	});
});
</script>
<h3>multiSelect = false</h3>
<div id="combo1" class="combo"></div><br/>
&nbsp;&nbsp;<button id="get1">get1</button>&nbsp;<button id="set1">set1</button>
<h3>multiSelect = true</h3>
<div id="combo2" class="combo"></div><br/>
&nbsp;&nbsp;<button id="get2">get2</button>&nbsp;<button id="set2">set2</button></div>
<textarea class="demoSource" wrap="off"></textarea>
<iframe src="/mac/js/related.php" class="related"></iframe>
<div id="foot">
Copyright © 2011. All rights reserved&nbsp;&nbsp;蜀ICP备11014774号-1&nbsp;&nbsp;
QQ: 7213571&nbsp;&nbsp;E-mail: pyh_jerry@163.com&nbsp;&nbsp;
<!-- 
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ffc0b0282216be3d16055855d8c0e72d9' type='text/javascript'%3E%3C/script%3E"));
</script>
&nbsp;&nbsp;
 -->
</div></body>
</html>
